// 文件位置: src/main/java/com/pharmacy/LogManage/dao/OperationLogMapper.java
package com.pharmacy.LogManage.dao;

import com.pharmacy.LogManage.entity.OperationLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface OperationLogMapper {
    List<OperationLog> findAllLogs();
    List<OperationLog> findLogsByDateRange(Date startDate, Date endDate);
    List<OperationLog> findLogsByUserId(Integer userId);
    List<OperationLog> findLogsByOperationType(String operationType);
    int insertLog(OperationLog operationLog);
    // 新增方法
    int deleteLogById(@Param("id") Integer id);
    int deleteAllLogs();

    // 新增组合查询方法
    List<OperationLog> findLogsWithConditions(@Param("operationType") String operationType,
                                              @Param("targetType") String targetType,
                                              @Param("userId") Integer userId,
                                              @Param("startDate") Date startDate,
                                              @Param("endDate") Date endDate);

}